package com.hanbit.member.service;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.hanbit.member.mapper.MemberMapper;
import com.hanbit.member.model.Member;


@Repository("MemberServiceImpl")
public class MemberServiceImpl implements MemberService{

	@Autowired
	private SqlSessionTemplate sessionTemplate;

	/*public void setSessionTemplate(SqlSessionTemplate sessionTemplate) {
		this.sessionTemplate = sessionTemplate;
	}*/

	@Override
	@Transactional
	public int addMember(Member member) {
		return sessionTemplate.getMapper(MemberMapper.class).addMember(member);
	}

	@Override
	public int updateMember(Member member) {
		return sessionTemplate.getMapper(MemberMapper.class).updateMember(member);
	}

	@Override
	public int removeMember(Member member) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Member getMember(String id) {
		return sessionTemplate.getMapper(MemberMapper.class).getMember(id);
	}

	@Override
	public List<Member> getMemberList() {
		// TODO Auto-generated method stub
		return null;
	}

	
}
